﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    <script src="../../Scripts/boot.js"></script>
     
</head>
<body>
   <div style="padding-bottom:5px;">
        
        <span>员工姓名：</span><input type="text" id="key"  />
        <input type="button" value="查找" onclick="search()"/>
        
        
    </div>
<div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;" 
    url="../Button/GetButtonControler"  idField="ControlId" allowResize="true"
    sizeList="[20,30,50,100]" pageSize="20" 
>
    <div property="columns">
        <div type="indexcolumn" ></div>
        <div field="ControlName" width="120" headerAlign="center" allowSort="true">员工帐号</div>    
        <div field="ControlOrder" width="120" headerAlign="center" allowSort="true">姓名</div>                            
        <div field="ControlIcon" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别</div>
        <div field="Remark" dataType="currency" currencyUnit="￥" align="right" width="100" allowSort="true">薪资</div>                               
                      
    </div>
</div>   
   
   <script type="text/javascript">
       mini.parse();


       var grid = mini.get("datagrid1");


       grid.load();



       //对"createtime"字段，进行降级排序
       grid.sortBy("createtime", "desc");

       function search() {
           var key = document.getElementById("key").value;
           grid.load({ key: key });
       }
       $("#key").bind("keydown", function (e) {
           if (e.keyCode == 13) {
               search();
           }
       });
       ///////////////////////////////////////////////////////
       var Genders = [{ id: 1, text: '男' }, { id: 2, text: '女' }];
       function onGenderRenderer(e) {
           for (var i = 0, l = Genders.length; i < l; i++) {
               var g = Genders[i];
               if (g.id == e.value) return g.text;
           }
           return "";
       }
    </script>

    <div class="description">
        <h3>Description</h3>
        
    </div>
</body>
</html>
